<template>
    <div class="shopsearch">
        <!-- 列表综合排序按钮 -->
        <div class="shop_btn">
            <div>综合排序</div>
            <div>综合排序</div>
            <div>综合排序</div>
            <div>综合排序</div>
        </div>
        <!-- 综合排序按钮下面的列表 -->
        <div class="btn_list">
            <div>年货节热卖</div>
            <div>津贴联盟</div>
        </div>
        <!-- 店铺列表 -->
        <div class="shop_list" v-for="(item,index) in goodlist" :key="index" @click="toDetail(item)">
            <div class="shop_icon">
                <img :src="item.picUrl" alt="">
            </div>
            <div class="shop_text">
                <div class="name">
                    {{item.name}}
                </div>
                <div class="shop_message">
                    <div>
                        <span>★{{item.wmPoiScore/10}} </span>&nbsp;
                        <span>{{item.monthSalesTip}} </span>&nbsp;
                        <span>{{item.shippingFeeTip}}</span>
                    </div>
                    <div>
                        <span>{{item.deliveryTimeTip}}</span>&nbsp;
                        <span>{{item.distance}}</span>
                    </div>
                </div>
                <div class="discounts">
                    <span v-for="(a,b) in item.discounts2" :key="b">{{a.info}}</span>
                </div>
                <div class="good_details">
                    <div class="good">
                        <div class="good_img">
                            <img :src="item.picUrl" alt="">
                        </div>
                        <div class="good_name">
                            挪威三文鱼刺身
                        </div>
                        <div class="good_price">
                            ￥45
                        </div>
                    </div>
                </div>
                
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props:{
        goodlist:{
            type:Array,
            default:[]
        }
    },
    methods:{
        toDetail(item){ //跳转到详情页
            this.$router.push('/detail/'+item.mtWmPoiId);
        },
    }
}
</script>

<style lang="scss" scoped>
    .shopsearch{
        width: 100%;
        .shop_btn{
            width: 100%;
            display: flex;
            justify-content: space-between;
            padding: 0 16px;
            box-sizing: border-box;
            div{
                padding: 5px;
                margin: 10px 0;
            }
        }
        .btn_list{
            width: 100%;
            display: flex;
            padding: 0 16px;
            box-sizing: border-box;
            flex-wrap: wrap;
            div{
                padding: 7px 15px;
                background: #f5f5f5;
                border-radius: 5px;
                margin-right: 10px;
                margin-bottom: 10px;
                font-size: 14px;
            }
        }
        .shop_list{
            width: 100%;
            padding: 0 16px;
            display: flex;
            box-sizing: border-box;
            margin: 10px 0;
            .shop_icon{
                width: 40px;
                margin-right: 10px;
                img{
                    width: 100%;
                }
            }
            .shop_text{
                width: 77%;
                .name{
                    font-weight: bold;
                    margin-bottom:5px ;
                }
                .shop_message{
                    display: flex;
                    justify-content: space-between;
                    color: #999;
                    font-size: 12px;
                    margin-bottom:5px ;
                    div:nth-child(1){
                        span:nth-child(1){
                            color: red;
                        }
                    }
                }
                .discounts{
                    margin-bottom:5px ;
                    span{
                        display: inline-block;
                        padding: 1px 5px;
                        margin-right: 5px;
                        font-size: 12px;
                        background: rgb(249, 243, 243);
                        color: red;
                        
                    }
                }
                .good_details{
                    display: flex;
                    margin-right: 10px;
                    .good{
                        width: 40%;
                        .good_img{
                            width: 100%;
                            margin-bottom:5px ;
                            img{
                                width: 100%;
                            }
                        }
                        .good_name{
                            font-size: 14px;
                            margin-bottom:5px ;
                        }
                        .good_price{
                            color: red;
                        }
                    }
                }
            }
        }
    }
</style>